<template>
  <div class="paymentScheduleDetail">
    <section class="header">
      <span @click="goback">
        <i class="iconfont iconfanhui1"></i>
        缴纳进度{{name?'/'+name:''}}
      </span>
    </section>
    <div class="table">
      <el-table :data="tableData" tooltip-effect="dark" v-loading="loading" style="width: 100%">
        <el-table-column prop="payYearMonth" fixed label="缴纳月份" ></el-table-column>
        <el-table-column
          prop="sbBaseValue"
          label="社保缴纳基数"
          :formatter="numFilter"
          
        ></el-table-column>
        <el-table-column prop="sbMoney" label="社保缴纳金额" :formatter="numFilter" ></el-table-column>
        <el-table-column
          prop="gjjBaseValue"
          label="公积金缴纳基数"
          :formatter="numFilter"
          
        ></el-table-column>
        <el-table-column
          prop="gjjMoney"
          label="公积金缴纳金额"
          :formatter="numFilter"
          
        ></el-table-column>
      </el-table>
      <el-pagination
        
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page.sync="current"
        :page-sizes="[6,12, 24, 36]"
        :page-size="pageSize"
        layout="sizes, prev, pager, next"
        :total="total"
      ></el-pagination>
    </div>
  </div>
</template>

<script>
import base from "@/assets/js/base";
    import { requestApiPost } from '../api/api';
    import { reqRep } from '../report/reqReport';
    import { resRep } from "../report/resReport";
export default {
  name: "paymentScheduleDetail",
  data() {
    return {
      loading: false,
      name: "",
      total: null,
      current: 1,
      pageSize:6,
      tableData: []
    };
  },
  methods: {
    handleCurrentChange(e) {
      this.current = e;
      this.getData();
    },
    handleSizeChange(e) {
      this.pageSize = e;
      this.getData();
    },
    goback() {
      if (sessionStorage.getItem("urlParameter") == 200) {
        this.$router.push('paymentSchedule');
      } else if (sessionStorage.getItem("urlParameter") == 300) {
        this.$router.push('employeesList');
      } else if (sessionStorage.getItem("urlParameter") == 400) {
        this.$router.push('personageManagement');
      } else if (sessionStorage.getItem("urlParameter") == 500) {
        this.$router.push('paymentSchedules');
      }
    },
    numFilter(a, b, c) {
      return c;
    },
    //个人缴纳进度详情
    getData() {
      this.loading = true;
      this.tableData = [];
      base
        .getAjax("/bizUser/paymentSchedulePersonal", {
          userId: JSON.parse(sessionStorage.getItem("userInfo")).userId,
          pageNum: this.current,
          pageSize: this.pageSize
        })
        .then(res => {
          this.loading = false;
          if (res.data.code == 1) {
            this.total = parseInt(resReport.data.total);
            this.tableData = res.data.data;
          } else {
            this.$message.error(res.data.message);
          }
        });
    }
  },
  created() {
    this.name = JSON.parse(sessionStorage.getItem("userInfo")).name;
    this.getData();
  }
};
</script>
<style scoped>
.header {
  padding: 15px;
  height: 50px;
  box-sizing: border-box;
  font-size: 14px;
  border-bottom: 1px solid #eee;
}
.header i {
  margin-right: 5px;
}
.header span {
  cursor: pointer;
}
.table{
  margin-top: 4px;
}
.table .content {
  display: inline-block;
  border-right: 1px solid #ccc;
}
.table .content:last-child {
  border: none;
}
.table .content > section {
  padding: 10px 15px;
}
.table .content > section span {
  margin-right: 10px;
  display: inline-block;
  width: 80px;
  color: #999;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.table .content > section span:nth-child(2) {
  text-align: center;
}
.table .content > section span:last-child {
  margin-right: 0;
  text-align: center;
}
.rests {
  float: right;
}
</style>
